package com.ayf.payment.game.api.entity;

import com.ayf.payment.game.api.entity.base.BaseEntity;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 商户支付宝代付订单表
 */
@Data
@Table(name = "g_merchant_alipay_order")
public class MerchantAlipayOrder extends BaseEntity {

    /**
     * 商户号
     */
    @Column(name = "merchant_id")
    private Integer merchantId;

    /**
     * 商户appid
     */
    @Column(name = "app_id")
    private String appId;

    /**
     * 批次号
     */
    @Column(name = "bath_no")
    private String bathNo;

    /**
     * 商户订单号
     */
    @Column(name = "merchant_order_no")
    private String merchantOrderNo;

    /**
     * 支付宝转账订单号
     */
    @Column(name = "ali_order_id")
    private String aliOrderId;

    /**
     * 支付宝支付资金流水号
     */
    @Column(name = "ali_pay_fund_order_id")
    private String aliPayFundOrderId;

    /**
     * 付款金额 单位:元
     */
    @Column(name = "trans_amount")
    private BigDecimal transAmount;

    /**
     * 代付手续费
     */
    @Column(name = "fee")
    private BigDecimal fee;

    /**
     * 付款类型  1-支付宝 2-银行卡
     */
    @Column(name = "pay_type")
    private Integer payType;

    /**
     * 收款账号
     */
    @Column(name = "account_no")
    private String accountNo;

    /**
     * 收款人姓名
     */
    @Column(name = "`name`")
    private String name;

    /**
     * 付款申请时间
     */
    @Column(name = "apply_time")
    private Date applyTime;

    /**
     * 付款完成时间
     */
    @Column(name = "finish_time")
    private Date finishTime;

    /**
     * 付款说明
     */
    @Column(name = "remark")
    private String remark;

    /**
     * 付款状态:0-等待付款 1-付款处理中 2-付款成功 3-付款失败
     */
    @Column(name = "`status`")
    private Integer status;

    /**
     * 支付宝返回失败code
     */
    @Column(name = "ali_fail_code")
    private String aliFailCode;

    /**
     * 支付宝返回失败描述
     */
    @Column(name = "ali_fail_msg")
    private String aliFailMsg;

    /**
     * 付款失败原因
     */
    @Column(name = "fail_reason")
    private String failReason;

    /**
     * 订单创建日期 格式:yyyyMMdd
     */
    @Column(name = "create_date_index")
    private Integer createDateIndex;
    @Column(name = "order_source")
    private Integer orderSource;

    /**
     * 是否自己企业支付宝 1是 0否
     */
    @Column(name = "`self_flag`")
    private Integer selfFlag;

    private static final long serialVersionUID = 1L;
}